<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="java.util.Date,com.padgett.resourcemanagement.util.DateUtil" %>
<!DOCTYPE HTML>
<html>
<head>
<%
String clientId=(String)request.getAttribute("clientId");
String clientName=(String)request.getAttribute("Name");
String clientType=(String)request.getAttribute("Type");
%>
<title>Client - <%=clientName %></title>
<%@include file="/WEB-INF/css.jsp" %>
<%@include file="/WEB-INF/javascript.jsp" %>
<style>
.BusinessClientContainer{
	width:1024px;
	height:400px;
	padding:10px;
	margin:10px;
	border:1px solid #a3a3a3;
}
</style>
<script>
$(document).ready(function(){
	var clientType="<%=clientType%>";
	$('#EditClientButton').button().click(function(){
		if(clientType.toLowerCase()=='business'){
			$('#BusinessClientDialog').dialog('open');
		}else{
			$('#PersonalClientDialog').dialog('open');
		}
	});
	$('#BackToClientListButton').button().click(function(){
		window.location.href='/clients.jsp';
	});
	$('#ClientServicesButton').button().click(function(){
		window.location.href='/services.jsp?clientId=<%=clientId %>&clientName=<%=clientName%>';
	});
	$('#ClientInvoicesButton').button().click(function(){
		window.location.href='/invoices.jsp?clientId=<%=clientId %>&clientName=<%=clientName%>';
	});
});
</script>
</head>
<body>
<%@include file="/WEB-INF/clientnavigation.jsp" %>
<div class="ClientListContainer" style="margin-bottom:10px;margin-top:-20px;">
	<h1>CLIENT PROFILE</h1>
<div id="ClientActionsContainer" style="float:left;width:100%;margin:0 0 10px 18px">
<button id="BackToClientListButton">Back to Client List</button>
<button id="EditClientButton">Edit</button>
<button id="ClientServicesButton">Services</button>
<button id="ClientInvoicesButton">Invoices</button>
</div><br/>
<%
if(clientType.equalsIgnoreCase("business")){
%>
<%@include file="/WEB-INF/businessclientdialog.jsp" %>
<div class="ClientContainer">
<table>
	<tr>
		<td class="kheader">Client No:</td><td><input id="clientId" name="clientId" type="hidden" value="<%=request.getAttribute("clientId") %>"/><%=request.getAttribute("ClientNumber") %></td>
	</tr>
	<tr>
		<td class="kheader">Legal Name:</td><td><%=(request.getAttribute("Name")!=null?request.getAttribute("Name"):"") %></td>
	</tr>
	<tr>
		<td class="kheader">Business Name:</td><td><%=(request.getAttribute("BusinessName")!=null?request.getAttribute("BusinessName"):"") %></td>
	</tr>
	<%
		Date expiryDate=(Date)request.getAttribute("ExpiryDate");
		if(expiryDate!=null){
			out.print("<tr><td class='kheader'>Expiry Date:</td><td>"+DateUtil.formatDate(expiryDate,DateUtil.LONG_DATE_FORMAT)+"</td></tr>");
		}
	%>
	<tr>
		<td class="kheader">Registered Address:</td><td><%=(request.getAttribute("RegisteredAddress")!=null?request.getAttribute("RegisteredAddress"):"") %></td>
	</tr>
	<tr>
		<td class="kheader">Business Address:</td><td><%=(request.getAttribute("BusinessAddress")!=null?request.getAttribute("BusinessAddress"):"") %></td>
	</tr>
	<tr>
		<td class="kheader">Mailing Address:</td><td><%=(request.getAttribute("MailingAddress")!=null?request.getAttribute("MailingAddress"):"") %></td>
	</tr>
	<tr>
		<td class="kheader">Contact Person:</td><td>
		<%=(request.getAttribute("ContactPerson")!=null?request.getAttribute("ContactPerson"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Business Phone:</td><td>
		<%=(request.getAttribute("BusinessPhone")!=null?request.getAttribute("BusinessPhone"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Home Phone:</td><td>
		<%=(request.getAttribute("HomePhone")!=null?request.getAttribute("HomePhone"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Cell Phone:</td><td>
		<%=(request.getAttribute("CellPhone")!=null?request.getAttribute("CellPhone"):"") %></td>
	</tr>
	<tr>
		<td class="kheader">Fax:</td><td>
		<%=(request.getAttribute("Fax")!=null?request.getAttribute("Fax"):"") %></td>
	</tr>
	<tr>
		<td class="kheader">Email:</td><td>
		<%=(request.getAttribute("Email")!=null?request.getAttribute("Email"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Nature of Business:</td>
		<td>
		<%=(request.getAttribute("NatureOfBusiness")!=null?request.getAttribute("NatureOfBusiness"):"") %>
		</td>
	</tr>
	<%
		Date fiscalYearEnd=(Date)request.getAttribute("FiscalYearEnd");
		if(fiscalYearEnd!=null){
			out.print("<tr><td class='kheader'>Fiscal Year End:</td><td>"+DateUtil.formatDate(fiscalYearEnd,DateUtil.LONG_DATE_FORMAT)+"</td></tr>");
		}
	%>
	<tr>
		<td class="kheader">Status:</td>
		<td>
		<%=(request.getAttribute("Status")!=null?request.getAttribute("Status"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Including:</td>
		<td>
		<%=(request.getAttribute("Article")!=null&&(Boolean.parseBoolean((String)request.getAttribute("Article")))==true?"Article":"") %>
		<%=(request.getAttribute("Form1")!=null&&(Boolean.parseBoolean((String)request.getAttribute("Form1")))==true?"Form1":"") %>
		<%=(request.getAttribute("HST")!=null&&(Boolean.parseBoolean((String)request.getAttribute("HST")))==true?"HST":"") %>
		<%=(request.getAttribute("Payroll")!=null&&(Boolean.parseBoolean((String)request.getAttribute("Payroll")))==true?"Payroll":"") %>
		<%=(request.getAttribute("Tax")!=null&&(Boolean.parseBoolean((String)request.getAttribute("Tax")))==true?"Tax":"") %>
		<%=(request.getAttribute("ImportExport")!=null&&(Boolean.parseBoolean((String)request.getAttribute("ImportExport")))==true?"ImportExport":"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Business No.:</td><td>
		<%=(request.getAttribute("BusinessNumber")!=null?request.getAttribute("BusinessNumber"):"") %>
		<%=((request.getAttribute("BusinessNumberConsentForm")!=null&&(Boolean.parseBoolean((String)request.getAttribute("BusinessNumberConsentForm")))==true)?"w/ Consent Form":"No Consent Form") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">WSIB No.:</td><td>
		<%=(request.getAttribute("WSIBNumber")!=null?request.getAttribute("WSIBNumber"):"") %>
		<%=((request.getAttribute("WSIBNumberConsentForm")!=null&&(Boolean.parseBoolean((String)request.getAttribute("WSIBNumberConsentForm")))==true)?"w/ Consent Form":"No Consent Form") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">EHT No.:</td><td>
		<%=(request.getAttribute("EHTNumber")!=null?request.getAttribute("EHTNumber"):"") %>
		<%=((request.getAttribute("EHTNumberConsentForm")!=null&&(Boolean.parseBoolean((String)request.getAttribute("EHTNumberConsentForm")))==true)?"w/ Consent Form":"No Consent Form") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Accountant:</td><td>
		<%=(request.getAttribute("AccountantName")!=null?request.getAttribute("AccountantName"):"") %></td>
	</tr>
	<tr>
		<td class="kheader">PAS ID:</td><td>
		<%=(request.getAttribute("PASID")!=null?request.getAttribute("PASID"):"") %></td>
	</tr>
	<tr>
		<td class="kheader">Type of Services:</td>
		<td>
			<%=(request.getAttribute("TypeOfServices")!=null?request.getAttribute("TypeOfServices"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Pickup Date:</td>
		<td>
			<%=(request.getAttribute("PickupDate")!=null?request.getAttribute("PickupDate"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Note:</td>
		<td>
			<%=(request.getAttribute("Note")!=null?request.getAttribute("Note"):"") %>
		</td>
	</tr>
</table>
</div>
<%
}else{
	// Display personal panel
%>
<%@include file="/WEB-INF/personalclientdialog.jsp" %>
<div class="ClientContainer">
<table>
	<tr>
		<td class="kheader">Client No:</td><td><input id="clientId" name="clientId" type="hidden" value="<%=request.getAttribute("clientId") %>"/><%=request.getAttribute("ClientNumber") %></td>
	</tr>
	<tr>
		<td class="kheader">Last Name:</td><td><%=(request.getAttribute("LastName")!=null?request.getAttribute("LastName"):"") %></td>
	</tr>
		<tr>
		<td class="kheader">First Name:</td><td><%=(request.getAttribute("FirstName")!=null?request.getAttribute("FirstName"):"") %></td>
	</tr>
	<tr>
		<td class="kheader">Email:</td><td>
		<%=(request.getAttribute("Email")!=null?request.getAttribute("Email"):"") %></td>
	</tr>
	<tr>
		<td class="kheader">Home Phone:</td><td>
		<%=(request.getAttribute("HomePhone")!=null?request.getAttribute("HomePhone"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Cell Phone:</td><td>
		<%=(request.getAttribute("CellPhone")!=null?request.getAttribute("CellPhone"):"") %></td>
	</tr>
		<tr>
		<td class="kheader">Work Phone:</td><td>
		<%=(request.getAttribute("WorkPhone")!=null?request.getAttribute("WorkPhone"):"") %></td>
	</tr>
	<tr>
		<td class="kheader">No. Of Returns:</td><td>
		<%=(request.getAttribute("NumberOfReturns")!=null?request.getAttribute("NumberOfReturns"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Date In:</td>
		<td>
		<%
		Date dateIn=(Date)request.getAttribute("DateIn");
		if(dateIn!=null){
			out.print(DateUtil.formatDate(dateIn,DateUtil.LONG_DATE_FORMAT));
		}
		%>
		</td>
	</tr>
	<tr>
		<td class="kheader">Date Completed:</td>
		<td>
		<%
		Date dateCompleted=(Date)request.getAttribute("DateCompleted");
		if(dateCompleted!=null){
			out.print(DateUtil.formatDate(dateCompleted,DateUtil.LONG_DATE_FORMAT));
		}
		%>
		</td>
	</tr>
	<tr>
		<td class="kheader">No. Of Returns Completed:</td>
		<td>
		<%=(request.getAttribute("NumberOfReturnsCompleted")!=null?request.getAttribute("NumberOfReturnsCompleted"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">No. Of Returns Signed:</td>
		<td>
		<%=(request.getAttribute("NumberOfReturnsSigned")!=null?request.getAttribute("NumberOfReturnsSigned"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">No. Of Returns EFiled:</td>
		<td>
		<%=(request.getAttribute("NumberOfReturnsEFiled")!=null?request.getAttribute("NumberOfReturnsEFiled"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Date EFiled:</td>
		<td>
		<%
		Date dateEFiled=(Date)request.getAttribute("DateEFiled");
		if(dateEFiled!=null){
			out.print(DateUtil.formatDate(dateEFiled,DateUtil.LONG_DATE_FORMAT));
		}
		%>
		</td>
	</tr>
	<tr>
		<td class="kheader">No. Of Returns Paper Filed:</td>
		<td>
		<%=(request.getAttribute("NumberOfReturnsPaperFiled")!=null?request.getAttribute("NumberOfReturnsPaperFiled"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Date Filed:</td>
		<td>
		<%
		Date dateFiled=(Date)request.getAttribute("DateFiled");
		if(dateFiled!=null){
			out.print(DateUtil.formatDate(dateFiled,DateUtil.LONG_DATE_FORMAT));
		}
		%>
		</td>
	</tr>
	<tr>
		<td class="kheader">Fee:</td>
		<td>
		$<%=(request.getAttribute("Fee")!=null?request.getAttribute("Fee"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Method Of Payment:</td>
		<td>
		<%=(request.getAttribute("MethodOfPayment")!=null?request.getAttribute("MethodOfPayment"):"") %>
		</td>
	</tr>
	<tr>
		<td class="kheader">Fee Collected:</td><td>
		$<%=(request.getAttribute("FeeCollected")!=null?request.getAttribute("FeeCollected"):"") %></td>
	</tr>
	<tr>
		<td class="kheader">Date Collected:</td>
		<td>
		<%
		Date dateCollected=(Date)request.getAttribute("DateCollected");
		if(dateCollected!=null){
			out.print(DateUtil.formatDate(dateCollected,DateUtil.LONG_DATE_FORMAT));
		}
		%>
		</td>
	</tr>
	<tr>
		<td class="kheader">Accountant:</td><td>
		<%=(request.getAttribute("AccountantName")!=null?request.getAttribute("AccountantName"):"") %></td>
	</tr>
	<tr>
		<td class="kheader">Note:</td>
		<td>
			<%=(request.getAttribute("Note")!=null?request.getAttribute("Note"):"") %>
		</td>
	</tr>
</table>
</div>
<%
}
%>
</div>
</body>
</html>